package com.homedo.microservice.open.service.gateway.alert.gateway.bean.po.enhanced;

import com.homedo.common.dao.bean.po.enhanced.base.BaseEnhanced;
import com.homedo.microservice.open.service.gateway.alert.gateway.bean.po.ConfigRelation;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @author 作者 jgshun
 * @date 创建时间 2018年09月28日 13时58分20秒
 */
public class ConfigRelationEnhanced extends BaseEnhanced {
    public ConfigRelationEnhanced(ConfigRelation configRelation) {

        BeanUtils.copyProperties(configRelation, this);

        //自动生成 细微误差自己调整
        if (configRelation.getZuulFilterId() != null) {
            ZuulFilterEnhanced zuulFilterEnhanced = new ZuulFilterEnhanced();
            zuulFilterEnhanced.setFilterId(configRelation.getZuulFilterId());
            this.zuulFilterEnhanced = zuulFilterEnhanced;
        }
        if (configRelation.getConfigName() != null && configRelation.getApplicationName() != null) {
            ConfigEnhanced configEnhanced = new ConfigEnhanced();
            configEnhanced.setApplicationName(configRelation.getApplicationName());
            configEnhanced.setName(configRelation.getConfigName());
            this.configEnhanced = configEnhanced;
        }
    }

    public ConfigRelationEnhanced() {
    }

    private Integer id;
    private String applicationName;
    private ZuulFilterEnhanced zuulFilterEnhanced;
    private ConfigEnhanced configEnhanced;
    private Boolean global;
    private Date createTime;
    private Date updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getApplicationName() {
        return applicationName;
    }

    public void setApplicationName(String applicationName) {
        this.applicationName = applicationName;
    }

    public ZuulFilterEnhanced getZuulFilterEnhanced() {
        return zuulFilterEnhanced;
    }

    public void setZuulFilterEnhanced(ZuulFilterEnhanced zuulFilterEnhanced) {
        this.zuulFilterEnhanced = zuulFilterEnhanced;
    }

    public ConfigEnhanced getConfigEnhanced() {
        return configEnhanced;
    }

    public void setConfigEnhanced(ConfigEnhanced configEnhanced) {
        this.configEnhanced = configEnhanced;
    }

    public Boolean getGlobal() {
        return global;
    }

    public void setGlobal(Boolean global) {
        this.global = global;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }


}